package org.example.controller.impl;

import org.example.controller.OperationLogController;
import org.example.domain.response.ResponseResult;
import org.example.services.impl.OperationLogServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/operationLogs")
public class OperationLogImpl implements OperationLogController {

    @Autowired
    private OperationLogServiceImpl operationLogService;

    @GetMapping("/{pageSize}/{currentPage}")
    @PreAuthorize("hasAuthority('operation:selectAll')")
    public ResponseResult getOperation(@PathVariable int pageSize,@PathVariable int currentPage){
        return operationLogService.getOperation(pageSize,currentPage);
    }

}
